
from enum import IntEnum, unique
@unique
class Errno(IntEnum):
    FAILED = -1
    INACTIVE_CLOSE = -2
    CONNECTION_LOST_UNEXPECTED = -3


class ConnectionStateError(Exception):
    def __init__(self, state):
        self.__state = state
    def __str__(self):
        return "ConnectionStateError:{}".format(self.__state)

# send or recv if remote inactive close
class InactiveCloseError(Exception):
    def __init__(self, msg):
       self.__msg = msg 
    def __str__(self):
        return self.__msg

class InvalidOperationError(Exception):
    def __init__(self, msg):
        self.__msg = msg
    def __str__(self):
        return "{}".format(self.__msg)
